/*
 * @Author: zyk 997610780@qq.com
 * @Date: 2022-09-30 16:44:20
 * @LastEditors: zyk 997610780@qq.com
 * @LastEditTime: 2022-10-08 11:24:28
 * @FilePath: \fifty-small-projects\37明日方舟干员一览\37.js
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
console.log(data);


let agent_container = document.querySelector('.agent')

let list = []
let page = 1
let page_size = 15

function createdAgent(obj){
  let agent = document.createElement('div')
  agent.classList.add('agent_item')
  agent.innerHTML = `
  <div class="agent_avatar">
    <img src="${obj.icon}" alt="${obj.cn}">
  </div>
  <div class="agent_index">${obj.index}</div>
  <div class="agent_name">${obj.cn}</div>
  <div class="agent_race"><span class="bold">种族</span>:${obj.race.toString()}</div>
  <div class="position"><span class="bold">定位</span>:${obj.position},${obj.class}</div>
  <div class="part"><span class="bold">特性</span>:${ obj.feature}</div>
  `
  // let part = document.createElement('div')
  // part.classList.add('part')
  // part.innerHTML = `<span class="bold">特性</span>:${ obj.feature}`
  // agent.appendChild(part)
  return agent
}

function getAgentList(){
  let lst = data.splice(list.length * page,page_size)
  list.push(...lst)
  lst.forEach(item=>{
    agent_container.appendChild(createdAgent(item))
  })
}

getAgentList()
